<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>WingPick Pro - 设备配置</title>
    <!-- Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- FontAwesome -->
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <!-- 自定义配置 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#1976D2',
                        'primary-variant': '#0D47A1',
                        secondary: '#FF6F00',
                        'secondary-variant': '#E65100',
                        background: '#F5F5F5',
                        surface: '#FFFFFF',
                        'on-surface': '#212121',
                        'on-surface-variant': '#757575',
                        border: '#E0E0E0',
                        success: '#4CAF50',
                        warning: '#FFC107',
                        error: '#F44336',
                        info: '#2196F3'
                    }
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .android-card {
                @apply bg-surface rounded-2xl shadow-sm p-4;
            }
            .android-button {
                @apply bg-primary text-white py-3 px-6 rounded-lg font-medium transition-all duration-200 active:scale-95;
            }
            .android-button-secondary {
                @apply bg-white text-primary border border-primary py-3 px-6 rounded-lg font-medium transition-all duration-200 active:scale-95;
            }
            .section-title {
                @apply text-xl font-semibold text-on-surface mb-3;
            }
            .checkbox-input {
                @apply w-5 h-5 rounded border-2 border-primary flex items-center justify-center cursor-pointer transition-all;
            }
            .checkbox-input-checked {
                @apply bg-primary;
            }
            .checkbox-input-checked::after {
                content: '✓';
                @apply text-white text-xs font-bold;
            }
            .step-indicator {
                @apply h-1 rounded-full flex-1 transition-all duration-300;
            }
            .step-indicator-active {
                @apply bg-primary;
            }
            .step-indicator-inactive {
                @apply bg-border;
            }
            .step-indicator-completed {
                @apply bg-primary;
            }
            .tag {
                @apply px-2 py-0.5 bg-background rounded-full text-xs font-medium;
            }
            .tag-standard {
                @apply bg-blue-100 text-primary;
            }
            .tag-premium {
                @apply bg-orange-100 text-secondary;
            }
            .tag-custom {
                @apply bg-purple-100 text-purple-700;
            }
        }
    </style>
</head>
<body class="bg-background font-roboto text-on-surface min-h-screen">
    <!-- Android 状态栏 -->
    <div class="bg-primary h-7 w-full flex items-center justify-between px-4">
        <div class="text-white text-xs">18:30</div>
        <div class="flex items-center space-x-1">
            <i class="fa fa-signal text-white text-xs"></i>
            <i class="fa fa-wifi text-white text-xs"></i>
            <i class="fa fa-battery-three-quarters text-white text-xs"></i>
        </div>
    </div>

    <!-- 顶部导航栏 -->
    <header class="bg-primary text-white shadow-md">
        <div class="flex items-center h-14 px-4">
            <button id="backButton" class="mr-4">
                <i class="fa fa-arrow-left text-lg"></i>
            </button>
            <div class="text-lg font-semibold flex-1 text-center mr-4">配置报价</div>
        </div>
    </header>

    <!-- 步骤指示器 -->
    <div class="px-4 pt-4 pb-2">
        <div class="flex items-center justify-between mb-1">
            <span class="text-xs font-medium text-primary">3/4</span>
            <span class="text-xs font-medium text-on-surface-variant">设备配置</span>
        </div>
        <div class="flex items-center space-x-2">
            <div class="step-indicator step-indicator-completed"></div>
            <div class="step-indicator step-indicator-completed"></div>
            <div class="step-indicator step-indicator-active"></div>
            <div class="step-indicator step-indicator-inactive"></div>
        </div>
    </div>

    <!-- 产品信息 -->
    <div class="px-4 pb-4">
        <div class="android-card">
            <div class="flex items-center">
                <div class="w-16 h-16 rounded-lg overflow-hidden flex-shrink-0">
                    <img src="../../WingPick Pro/static/AC311A.png" alt="AC311A直升机" class="w-full h-full object-cover">
                </div>
                <div class="ml-3 flex-1">
                    <h2 class="font-semibold">AC311A</h2>
                    <p class="text-on-surface-variant text-sm">轻型多用途直升机</p>
                    <p class="text-primary font-medium">¥12,500,000</p>
                </div>
            </div>
        </div>
    </div>

    <!-- 主内容区 -->
    <main class="p-4 space-y-4 pb-24">
        <h1 class="text-xl font-bold mb-4">设备配置</h1>
        
        <!-- 航电系统 -->
        <div class="android-card">
            <h2 class="text-lg font-semibold mb-3">航电系统</h2>
            
            <div class="space-y-3">
                <div class="flex items-center">
                    <div class="checkbox-input checkbox-input-checked mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">标准航电套装</span>
                        <span class="tag tag-standard ml-2">标配</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input checkbox-input-checked mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">自动驾驶系统</span>
                        <span class="tag tag-standard ml-2">标配</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">增强型气象雷达</span>
                        <span class="text-xs text-primary ml-2">+¥230,000</span>
                        <span class="tag tag-premium ml-2">高级</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">合成视景系统 (SVS)</span>
                        <span class="text-xs text-primary ml-2">+¥480,000</span>
                        <span class="tag tag-premium ml-2">高级</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">增强型近地警告系统 (EGPWS)</span>
                        <span class="text-xs text-primary ml-2">+¥180,000</span>
                        <span class="tag tag-premium ml-2">高级</span>
                    </div>
                </div>
            </div>
        </div>

        <!-- 任务设备 -->
        <div class="android-card">
            <h2 class="text-lg font-semibold mb-3">任务设备</h2>
            
            <div class="space-y-3">
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">外部货钩系统</span>
                        <span class="text-xs text-primary ml-2">+¥150,000</span>
                        <span class="tag tag-custom ml-2">定制</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">医疗救援设备套装</span>
                        <span class="text-xs text-primary ml-2">+¥320,000</span>
                        <span class="tag tag-custom ml-2">定制</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">搜索灯系统</span>
                        <span class="text-xs text-primary ml-2">+¥85,000</span>
                        <span class="tag tag-custom ml-2">定制</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">光电探测系统</span>
                        <span class="text-xs text-primary ml-2">+¥650,000</span>
                        <span class="tag tag-custom ml-2">定制</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">农业喷洒设备</span>
                        <span class="text-xs text-primary ml-2">+¥195,000</span>
                        <span class="tag tag-custom ml-2">定制</span>
                    </div>
                </div>
            </div>
        </div>

        <!-- 安全系统 -->
        <div class="android-card">
            <h2 class="text-lg font-semibold mb-3">安全系统</h2>
            
            <div class="space-y-3">
                <div class="flex items-center">
                    <div class="checkbox-input checkbox-input-checked mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">标准消防系统</span>
                        <span class="tag tag-standard ml-2">标配</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input checkbox-input-checked mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">应急浮筒</span>
                        <span class="tag tag-standard ml-2">标配</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">增强型飞行数据记录器</span>
                        <span class="text-xs text-primary ml-2">+¥95,000</span>
                        <span class="tag tag-premium ml-2">高级</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">紧急定位发射机 (ELT)</span>
                        <span class="text-xs text-primary ml-2">+¥45,000</span>
                        <span class="tag tag-premium ml-2">高级</span>
                    </div>
                </div>
                <div class="flex items-center">
                    <div class="checkbox-input mr-3"></div>
                    <div class="flex-1">
                        <span class="font-medium">弹道回收系统 (可选)</span>
                        <span class="text-xs text-primary ml-2">+¥280,000</span>
                        <span class="tag tag-premium ml-2">高级</span>
                    </div>
                </div>
            </div>
        </div>

        <!-- 底部操作按钮 -->
        <div class="fixed bottom-0 left-0 right-0 bg-surface p-4 border-t border-border">
            <div class="flex justify-between items-center mb-3">
                <span class="text-sm text-on-surface-variant">设备总价:</span>
                <span id="currentPrice" class="text-xl font-semibold text-primary">¥0</span>
            </div>
            <div class="flex space-x-3">
                <button id="prevButton" class="android-button-secondary flex-1">
                    上一步
                </button>
                <button id="nextButton" class="android-button flex-1">
                    下一步: 服务与保修
                </button>
            </div>
        </div>
    </main>

    <script>
        // 返回按钮点击事件
        document.getElementById('backButton').addEventListener('click', function() {
            window.location.href = 'config-interior.html';
        });

        // 上一步按钮点击事件
        document.getElementById('prevButton').addEventListener('click', function() {
            window.location.href = 'config-interior.html';
        });

        // 下一步按钮点击事件
        document.getElementById('nextButton').addEventListener('click', function() {
            // 跳转到服务与保修页面
            window.location.href = 'config-service.html';
        });

        // 复选框功能选择
        const checkboxInputs = document.querySelectorAll('.checkbox-input');
        checkboxInputs.forEach(checkbox => {
            checkbox.addEventListener('click', function() {
                // 跳过标配项目（保持选中状态）
                const isStandard = this.parentElement.querySelector('.tag-standard');
                if (isStandard) {
                    return; // 标配项目不可取消选择
                }
                
                // 切换选中状态
                this.classList.toggle('checkbox-input-checked');
                
                // 更新价格
                updateTotalPrice();
            });
        });

        // 价格计算函数
        function updateTotalPrice() {
            let totalPrice = 0;
            
            // 检查所有复选框
            checkboxInputs.forEach(checkbox => {
                if (checkbox.classList.contains('checkbox-input-checked')) {
                    // 获取价格信息
                    const priceElement = checkbox.parentElement.querySelector('.text-primary');
                    if (priceElement) {
                        // 提取数字并转换为整数
                        const priceText = priceElement.textContent;
                        const price = parseInt(priceText.replace(/[^\d]/g, ''));
                        totalPrice += price;
                    }
                }
            });
            
            // 更新价格显示
            const formattedPrice = new Intl.NumberFormat('zh-CN').format(totalPrice);
            document.getElementById('currentPrice').textContent = `¥${formattedPrice}`;
        }

        // 初始化时计算价格
        updateTotalPrice();
    </script>
</body>
</html>